<template>
  <div id="app">
    <h2>测试题</h2>
    <SubjectItem v-for="item in 5" :key="item" :item="item" @succed="succed"></SubjectItem>
    <div>
      <FlagItem v-for="item in 5" :key="item" :item="item" :list="list"></FlagItem>
    </div>
  </div>
</template>

<script>
import SubjectItem from "./components/SubjectItem";
import FlagItem from "./components/FlagItem.vue";
export default {
  data() {
    return {
      list: []
    }
  },
  components: {
    SubjectItem,
    FlagItem
  },
  methods: {
    succed(e) {
      // console.log(e);
      this.list = e
    }
  }
};
</script>

<style>
body {
  background-color: #eee;
}

#app {
  background-color: #fff;
  width: 500px;
  margin: 50px auto;
  box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.5);
  padding: 2em;
}
</style>